package org.xiaojinlong.exam;

import java.util.Scanner;

public class Factorial {

    public static int factorial(int n) {
        if (n == 1)
            return 1;
        else
            return n * factorial(--n);
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            System.out.println(factorial(scanner.nextInt()));
        }
    }
}
